[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
filelength() Return File Length
#include <io.h> Required for declarations only
long filelength(handle);
int handle; Handle referring to open file
filelength() returns the length of an open file associated with
'handle', in bytes.
Returns: The file length in bytes if successful. On error, -1L
is returned and 'errno' is set to EBADF (bad file
number).
Portability: MS-DOS only.
-------------------------------- Example ---------------------------------
The following statements open a file and find its length.
#include <io.h>
#include <stdio.h>
FILE *in;
long length;
main()
{
in = fopen("invoice.dat","r");
.
.
length = filelength(fileno(in));
}
See Also:
fileno()
fstat()
stat()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson